package ProjectTeam39.Domains;
import java.io.*;

public class UserList 
{
	
	Clientelle theClientelle;
	Employees theEmployees;
	String officeName;
	File theOffice;
	UserList ul = this;
	String directory = new String(System.getProperty("user.dir"));
	String sep = new String(System.getProperty("file.separator"));
	
	public UserList(String officeName)
	{
		this.officeName = officeName;
		theOffice = new File(directory+sep+officeName);
	 	this.initialize();
	}
	
	void initialize()
	{
		try
		{
			if(theOffice.mkdir())
			{
				System.out.println(officeName + " created");
			}
			else
			{
				System.out.println(officeName + " NOT created");
			}
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		theClientelle = new Clientelle(ul);
		theEmployees = new Employees(ul);
	}
	
	String getDir()
	{
		return (directory+sep+officeName);
	}
	
	String getSep()
	{
		return (sep);
	}
	
	Clientelle getClientelle()
	{
		return theClientelle;
	}
	
	Employees getEmployees()
	{
		return theEmployees;
	}
	
	/*public static void main(String args[])
	{
		UserList theUsers = new UserList("Test Office");
		Clientelle theClients = theUsers.getClientelle();
		Employees theEmployees = theUsers.getEmployees();
		theClients.linkUserList(theUsers);
		theEmployees.linkUserList(theUsers);
		System.out.println("WRITING");
		Patient test1 = new Patient("Kyle Kukshtel", 9198232, "MY HAUS", null, null, "kkukshtel3", "mypassword");
		Patient test2 = new Patient("SPENCER HAMMY HAM", 9198232, "MY HAUS", null, null, "spencyspence3", "spencyword");
		theClients.createClient(test1);
		theClients.createClient(test2);
		Patient test3 = theClients.getPatient("Kyle Kukshtel");
		System.out.println(test3.getPassword());
		System.out.println("DONE");
		System.out.println(theUsers.getDir());
	}*/
}
